Now that you have
a good overview of the three building blocks of the global HTTPS load balancer, let's discuss the first of the key reasons why you
might want to set up the global HTTPS load balancer and use it together
with Cloud Run. Cloud CDN. First, let's discuss why
you'd want to use Cloud CDN. The CDN, content
delivery network serves cacheable content
closer to clients, closer in terms of
network distance. Cacheable content is stored on an edge point of presence, while dynamic content is still served by the backend service. A CDN improves the availability and performance of
your application. The content in the Cloud
CDN store expires, and the store has a
limited total capacity so content might expire
earlier than expected. You enable Cloud CDN on
the backend service. You're not limited to backends
services with Cloud Run, any backend service
supports Cloud CDN. This means you can combine
using path-based routing, backends services that use Cloud CDN with ones that don't. To make sure the
CDN is effective, you'll need to
configure it correctly. Cloud CDN has three
modes that allow you to choose what
content is cacheable. Use cache headers. If your application
response to a web request, it needs to tell Cloud
CDN using a header how long it's allowed to
store the response before it needs to
fetch it again. The second setting is a
catch-all static content. In this case, you
can prevent caching by setting no-cache
response headers. The final setting is
cache all for an hour. It goes without saying that you need to be very
careful when enabling this mode because
there is no way to override the cache from
your application code. This can result in a lot of
cache storage being used. Your application
gains three benefits from using Cloud CDN. You can increase contents
availability with Cloud CDN, serving content
through Cloud CDN improves website performance, and if Cloud CDN
serves more requests, Cloud Run is not
handling the requests, which can be cheaper
for your use case.